package com.doform.android.xianggucheng.utils.thread;

import android.os.Handler;

/**
 * 作者 Y_MS
 * Created by ${APEN} on 2017/5/31.
 * GitHub：https://github.com/cxydxpx
 */

public class ThreadUtils {
    /**
     * 在子线程执行
     * @param runnable
     */
    public static  void runOnBackThread(Runnable runnable){
//        new Thread(runnable).start();   // 线程池
        ThreadPoolManager.getInstance().createThreadPool().execture(runnable);
    }

    private static Handler handler = new Handler();

    /**
     * 在主线程执行
     * @param runnable
     */
    public static  void runOnUiThread(Runnable runnable){
        handler.post(runnable);
    }


}
